﻿using System;
using System.IO;
using System.Text;

namespace PackageLinSample
{
    public class Logger
    {
        public void Log(string text)
        {
            if (text?.StartsWith("first") != false) {

                var me = new MaskEngine.MaskEngine();

                Console.WriteLine(me.Mask("firstName", text));

                return;
            }
            Console.WriteLine(text);
        }

        public void Log(object obj) {

            var serializer = new Newtonsoft.Json.JsonSerializer();

            var sb = new StringBuilder();

            var twriter = new StringWriter(sb);

            serializer.Serialize(twriter, obj, typeof(object));

            Console.WriteLine(sb.ToString());
        }
    }
}
